﻿using OnlineAuction.DataAccess;
using OnlineAuction.Entity;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;

namespace OnlineAuction.Business
{
    public class AuctionTypeBO
    {
        public List<AuctionTypeDTO> GetAuctionType()
        {
            //Get all auction type
            List<AuctionTypeDTO> list = new List<AuctionTypeDTO>();
            AuctionTypeDA da = new AuctionTypeDA();
            DataSet ds = da.GetAuctionType();
            //convert DataSet to List auction type
            foreach (DataRow row in ds.Tables[0].Rows)
            {
                list.Add(new AuctionTypeDTO(int.Parse(row["AuctionTypeID"].ToString()), row["AuctionTypeName"].ToString()));
            }
            return list;
        }
    }
}
